import {  message } from "ant-design-vue";
export   // 验证数据
const validateData = {
  xiaohongshu:(account,data,group_account_List)=>{
    let imgMinNum = _.find(group_account_List,{key:account.source})?.min_upload_number??0
    if(imgMinNum>0&&data.cover_img.length==0){
       message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请上传封面图`)
       return false
    }
    if(data.publishType==2&&!data.fix_at){//定时发布
       message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请选择发布时间`)
       return false
    }
    if(data.title.length==0){
      message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请输入标题`)
      return false
    }

    return true

  },
  sina_weibo:(account,data,group_account_List)=>{
    let imgMinNum = _.find(group_account_List,{key:account.source})?.min_upload_number??0
    if(imgMinNum>0&&data.cover_img.length==0){
       message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请上传封面图`)
       return false
    }
    if(data.publishType==2&&!data.fix_at){//定时发布
       message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请选择发布时间`)
       return false
    }
    if(data.title.length==0){
      message.warn(`平台：${account.source_txt}==>账号：${account.nickname}，请输入标题`)
      return false
    }
    return true
  },
}